package com.junmeng.jdemo.recycler.chat.contextmenu;

import androidx.annotation.Nullable;

import com.junmeng.jdemo.recycler.chat.contextmenu.base.ITypeContextMenu;
import com.junmeng.jdemo.recycler.chat.contextmenu.base.ITypeManager;

import java.util.HashMap;

public class TypeManager implements ITypeManager<String> {

    private HashMap<String, ITypeContextMenu> types = new HashMap<>();

    public TypeManager() {
        types.put(ContextMenuText.class.getSimpleName(), new ContextMenuText());
        types.put(ContextMenuImage.class.getSimpleName(), new ContextMenuImage());
    }

    public HashMap<String, ITypeContextMenu> getTypes() {
        return types;
    }

    @Nullable
    public ITypeContextMenu getType(String type) {
        return types.get(type);
    }
}
